home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / prgtools / prtsut53.zip / SU1SRC.ZIP / FDEMO04.PAS < prev    next >
Pascal/Delphi Source File  |  1996-12-09  |  3KB  |  120 lines

  1. unit Fdemo04;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   StdCtrls, Forms, DBCtrls, DB, DBGrids, Mask, DBTables, Grids, ExtCtrls,
  8.   PrnWin, Buttons, Printers, CB_Types, DBPrnWin, CB_MFunc;
  9.  
  10. type
  11.   TForm04 = class(TForm)
  12.     DBGrid1: TDBGrid;
  13.     DBNavigator: TDBNavigator;
  14.     Panel1: TPanel;
  15.     DataSource1: TDataSource;
  16.     Panel2: TPanel;
  17.     Panel3: TPanel;
  18.     Table1: TTable;
  19.     Table2: TTable;
  20.     DataSource2: TDataSource;
  21.     ScrollBox: TScrollBox;
  22.     Label1: TLabel;
  23.     Label2: TLabel;
  24.     Label3: TLabel;
  25.     Label4: TLabel;
  26.     Label5: TLabel;
  27.     Label6: TLabel;
  28.     Label7: TLabel;
  29.     EditCustNo: TDBEdit;
  30.     EditCompany: TDBEdit;
  31.     EditAddr: TDBEdit;
  32.     EditAddr2: TDBEdit;
  33.     EditCity: TDBEdit;
  34.     EditState: TDBEdit;
  35.     EditZip: TDBEdit;
  36.     Preview: TBitBtn;
  37.     Label9: TLabel;
  38.     Table2OrderNo: TFloatField;
  39.     Table2CustNo: TFloatField;
  40.     Table2SaleDate: TDateTimeField;
  41.     Table2ShipDate: TDateTimeField;
  42.     Table2ShipVIA: TStringField;
  43.     Table2Terms: TStringField;
  44.     Table2PaymentMethod: TStringField;
  45.     Table2ItemsTotal: TCurrencyField;
  46.     Table2AmountPaid: TCurrencyField;
  47.     Exit: TBitBtn;
  48.     DBNavigator1: TDBNavigator;
  49.     GroupBox1: TGroupBox;
  50.     Label8: TLabel;
  51.     CheckBox1: TCheckBox;
  52.     RadioButton1: TRadioButton;
  53.     RadioButton2: TRadioButton;
  54.     RadioGroup1: TRadioGroup;
  55.     RadioButton3: TRadioButton;
  56.     RadioButton4: TRadioButton;
  57.     Image1: TImage;
  58.     DBPrintWin1: TDBPrintWin;
  59.     procedure FormCreate(Sender: TObject);
  60.     procedure PreviewClick(Sender: TObject);
  61.     procedure ExitClick(Sender: TObject);
  62.   private
  63.     { private declarations }
  64.   public
  65.   end;
  66.  
  67. var
  68.   Form04: TForm04;
  69.  
  70. implementation
  71.  
  72. {$R *.DFM}
  73.  
  74. procedure TForm04.FormCreate(Sender: TObject);
  75. begin
  76.   Table1.Open;
  77.   Table2.Open;
  78. end;
  79.  
  80. procedure TForm04.PreviewClick(Sender: TObject);
  81. var
  82.     y: Real;
  83. begin
  84.    DBPrintWin1.BeginPrint;
  85.    DBPrintWin1.NewFont ('Arial',20,True,True,True);
  86.    DBPrintWin1.SetTheTextColor (RGB(255,0,0));
  87.    DBPrintWin1.DrawText( 1.2,poCenter,'The Customer');
  88.  
  89.    DBPrintWin1.NewFont ('Arial',18,False,False,False);
  90.    DBPrintWin1.SetTheTextColor (RGB(0,0,0));
  91.    DBPrintWin1.DrawWindow( 2.1,poCenter,ScrollBox);
  92.  
  93.  
  94.    y := 5.0;
  95.  
  96.    DBPrintWin1.SelectPen (2, RGB(255,0,0));
  97.  
  98.    DBPrintWin1.NewFont ('Arial',20,True,True,True);
  99.    DBPrintWin1.SetTheTextColor (RGB(255,0,0));
  100.    DBPrintWin1.DrawText( y,poCenter,'The Orders');
  101.  
  102.    DBPrintWin1.SetFrameStyle(frThinThick);
  103.  
  104.    DBPrintWin1.NewFont ('Arial',14,False,True,False);
  105.    DBPrintWin1.SetTheTextColor (RGB(0,0,0));
  106.    DBPrintWin1.DrawWindow( 6.0,poCenter, DBGrid1);
  107.  
  108.  
  109.    DBPrintWin1.EndPrint;
  110. end;
  111.  
  112.  
  113. procedure TForm04.ExitClick(Sender: TObject);
  114. begin
  115.     Close;
  116. end;
  117.  
  118.  
  119. end.
  120.